home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 December / PCWorld_2005-12_cd.bin / software / temacd / tiny / tpf-6[1].5.126.exe / Tiny Firewall 2005.msi / webui.dll / COMMON / SETTING.JS < prev    next >
Encoding:
Text (UTF-16)  |  2005-08-17  |  9.2 KB  |  161 lines

  1. /*//////////////////////////////////////////////////////////////////////
  2. Filename:          setting.js
  3. Company Name:      Computer Associates International, Inc.
  4. Legal Copyright: Copyright (c) Computer Associates International, Inc.
  5. Author:          Marek Matus (marek.matus@ca.com)
  6. Product:          Tiny Firewall
  7. Description:      global setting
  8. ///////////////////////////////////////////////////////////////////////*/
  9.  
  10. /*
  11. ProductType == 0 && Managed == 0 && IsAdmin == 1 => Multi user rezim
  12. ProductType == 0 && Managed == 0 && IsAdmin == 0 => Non-privileged user rezim
  13. ProductType == 0 && Managed == 1 => Non-privileged user rezim
  14. ProductType == 3 ||  ProductType == 1 => Single user rezim
  15. ProductType == 4 => VPN FW rezim
  16. */
  17. var _external = window.external; // can be changed to COM object when running in IE
  18.  
  19. function isLDAPSupported()
  20. {
  21.     return isServerOS() && isProVersion();
  22. }
  23.  
  24. function isUmxUTAInstalled()
  25. {
  26.     return ("yes" == external.UtaRegValueString("RUPresent"));
  27. }
  28.  
  29. function isSpywareProtection()
  30. {
  31.     return false;
  32.     //return (_external.ProductType == 5); //??
  33. }
  34.  
  35. function isVPNFirewall()
  36. {
  37.     return (_external.ProductType == PROD_TYPE_VPN_FIREWALL);
  38. }
  39. /* Returns true if server parser database can be changed. */
  40. /* Server database cannot be edited in "Non-privileged user mode"*/
  41. function isSPEditable()
  42. {
  43. //    return false;
  44.     return ((_external.ProductType == PROD_TYPE_PROFESSIONAL && _external.Managed == 0 && _external.IsAdmin == 1 ) ||
  45.         (_external.ProductType == PROD_TYPE_SINGLE_USER || _external.ProductType == PROD_TYPE_SINGLE_SERVER ) ||
  46.         (_external.ProductType == PROD_TYPE_VPN_FIREWALL ) ||
  47.         isSpywareProtection() );
  48. }
  49.  
  50. function isManaged()
  51. {
  52.     return (_external.Managed != 0);
  53. }
  54.  
  55. function isServerOS()
  56. {
  57. //    return true;
  58.     return _external.IsServerOS();
  59. }
  60.  
  61. function isProVersion()
  62. {
  63.     return (_external.ProductType == PROD_TYPE_PROFESSIONAL);
  64. }
  65.  
  66. /* Returns true if it is multi user mode */
  67. function isMultiUser()
  68. {
  69.     return _external.ProductType == 0 && _external.Managed == 0 && _external.IsAdmin == 1;
  70. }
  71.  
  72. /* Returns true  if client parser database should be visibel. */
  73. /* Client database is invisible in modes: "Single user, VPN " and
  74. if in user combo is "All Users" selected --> then ClientParser is null */
  75. function isCPVisible()
  76. {
  77. //        return false;
  78.     return !((_external.ProductType == PROD_TYPE_SINGLE_SERVER) ||
  79.                 (_external.ProductType == PROD_TYPE_SINGLE_USER) ||
  80.                 (_external.ProductType == PROD_TYPE_VPN_FIREWALL) ||
  81.                 (!_external.ClientParser(XM_FW) && !_external.ClientParser(XM_APPREP) && !_external.ClientParser(XM_SBX)) ||
  82.                 isSpywareProtection() );
  83. }
  84.  
  85. function showBatchOperation()
  86. {
  87.     return true;//(_external.ProductType == PROD_TYPE_PROFESSIONAL );
  88. }
  89.  
  90. /* Returns true if combo for selecting windows user should be visible */
  91. function isUsrSelectVisible()
  92. {
  93.     return (_external.ProductType == PROD_TYPE_PROFESSIONAL && _external.Managed == 0 && _external.IsAdmin == 1);
  94. }
  95.  
  96. /* Returns true if column with users should be visible in firewall rules list */
  97. function showUserColumnInFWRules()
  98. {
  99.     return (_external.ProductType == PROD_TYPE_PROFESSIONAL && _external.Managed == 0);
  100. }
  101.  
  102. /* Returns true if column with users should be visible in firewall rules list */
  103. function showAccountColumn()
  104. {
  105.     return (_external.ProductType == PROD_TYPE_PROFESSIONAL && _external.Managed == 0);
  106. }
  107.  
  108. function defaultSimpleViewFW()
  109. {
  110.     return (_external.ProductType == PROD_TYPE_SINGLE_USER || _external.ProductType == PROD_TYPE_SINGLE_SERVER );
  111. }
  112.  
  113. function defaultSimpleViewSBX()
  114. {
  115.     return (_external.ProductType == PROD_TYPE_SINGLE_USER || _external.ProductType == PROD_TYPE_SINGLE_SERVER );
  116. }
  117.  
  118. function bothViewAvailableFW()
  119. {
  120.     return true;//(_external.ProductType == PROD_TYPE_PROFESSIONAL);
  121. }
  122.  
  123. function bothViewAvailableSBX()
  124. {
  125.     return true;//(_external.ProductType == PROD_TYPE_PROFESSIONAL);
  126. }
  127.  
  128. function showEasyFWSetting()
  129. {
  130.     return (_external.ProductType == PROD_TYPE_SINGLE_USER || _external.ProductType == PROD_TYPE_SINGLE_SERVER );
  131. }
  132.  
  133. function showEasySBXSetting()
  134. {
  135.     return (_external.ProductType == PROD_TYPE_SINGLE_USER || _external.ProductType == PROD_TYPE_SINGLE_SERVER );
  136. }
  137.  
  138. function isPersonalVersion()
  139. {
  140.     return (_external.ProductType == PROD_TYPE_SINGLE_USER || _external.ProductType == PROD_TYPE_SINGLE_SERVER );
  141. }
  142.  
  143. function isContentFilterVisible()
  144. {
  145.     return ( window.external.ShowContentFilter == 1);
  146. }
  147.  
  148. function isButtonsOnLeft()
  149. {
  150.     return parseBoolean(external.CfgRegValueString('design_left_btns'));
  151. }
  152.  
  153. function is64bitOS()
  154. {
  155.     //return true;
  156.     return _external.Is64bitOS;
  157. }
  158.  
  159. var COLOR_DIRECT_ROW = 'darkblue';
  160. var COLOR_DB_ROW = 'darkred';
  161.